package com.rlyy.rsj.dao;

import com.rlyy.aibase.utils.base.MapNode;
import com.rlyy.rsj.entity.RemindLogTable;
import rsj.annotation.Param;
import rsj.annotation.Select;
import rsj.annotation.Update;

/**
 * 提醒DAO
 *
 * @author shibixiao
 * @description :
 * @date 2021/07/21
 */
public interface RemindDao {

    @Select(" SELECT remind_mode,remind_cond,remind_freq,remind_num,receive_user_id,remind_template,remind_open " +
            " FROM sys.sys_remind WHERE remind_type = #{remindType} " +
            " ORDER BY update_tm DESC limit 1 ")
    MapNode getRemindInfoByType(@Param("remindType") String remindType);

    @Update("INSERT INTO sys.sys_remind_log (remind_log_id,remind_type,remind_tm,remind_mode,receive_user,remind_content" +
            ",remind_status,fail_reason) VALUES (#{remindLogId},#{remindType},#{remindTm},#{remindMode}" +
            ",#{receiveUser},#{remindContent},#{remindStatus},#{failReason})")
    void writeRemindLog(RemindLogTable remindLog);

}
